<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <script>
        // var a = 0;
        // do {
        //     a++;
        //     document.write('<h3>' + 'today=' + a + '</h3>');
        // } while (a < 10);
        // var box = document.querySelector('.box');
        // var count = 3;
        // var pwd = '123456',
        //     inputPwd;
        do {
            inputPwd = prompt('请输入密码：');
            if (inputPwd == pwd) {
                document.write('<h2 style="color:#16A05D">密码正确</h2>');
                setTimeout(function() {
                    let money = parseInt(prompt('请输入取款金额：'));
                    alert('您的取款金额为：￥' + (money));
                }, 100);
                break;
            } else {
                alert('密码错误');
                // box.innerHTML = '<h2 style="color:red">密码错误</h2>';
                count--;
                console.log(count);
                if (count == 0) {
                    document.write('<h2  style="color:#B03634">今日密码输入达到限制，请明日再来!</h2>');
                }
                continue;
            }
        } while (count >= 1);
        // var arr1 = [];
        // for (var i = 0; i < 2; i++) {
        //     arr1[i] = function() {
        //         console.log(i);
        //     };
        // }
        // arr1[0]();
        // arr1[1]();
        // console.log('---------------');
        // let arr2 = [];
        // for (let i = 0; i < 2; i++) {
        //     arr2[i] = function() {
        //         console.log(i);
        //     };
        // }
        // arr2[0]();
        // arr2[1]();
    </script>
</body>


</html>